Is there a way to expand a table and keep the border highlighting intact?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,691
Office Version
  1. 365
Platform
  1. Windows
This comes up all the time. I have a table that I have carefully highlighted with borders. If I add a row in the middle, everything is good. But if I add one at the top or bottom, I get an extra top or bottom border. Is there any way to add a row at the top or bottom of a table with a border and keep the border intact and not get an extra border inside?

I'm going to try and post two examples, a before and an after. Here's the before:

MrExcel%2001%20Before.jpg


And here it is after I copied the bottom row:

MrExcel%2002%20After.jpg


I don't know if these links will work. I tried to test them, but the Test section seems to have the Insert Image button disabled. (sigh) In case they don't work, here the link to the Dropbox folder containing both images:

https://www.dropbox.com/sh/m2s5cen6410s2l4/AAAfdeS2UAGdbykNuiUz9fNqa?dl=0
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I mean before the first data row or after the last one.

Here's my table, but without the borders:

[TABLE="width: 293"]
<tbody>[TR]
[TD="align: center"]R/C
[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Price[/TD]
[TD="align: center"]Quan[/TD]
[TD="align: center"]Total
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: right"]05/01/18
[/TD]
[TD="align: right"]$250.00[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]$1,250.00
[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: right"]05/02/18[/TD]
[TD="align: right"]$225.00[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]$2,700.00
[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: right"]05/05/18[/TD]
[TD="align: right"]$280.00[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]$560.00
[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: right"]05/09/18[/TD]
[TD="align: right"]$210.00[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]$5,250.00[/TD]
[/TR]
</tbody>[/TABLE]

In the actual table, there are borders around C4:F4, C4:C8, D4:E8, and F4:F8.

If I replicate Row 8, I get a new Row 9 that has the bottom border, but Row 8 still has one, too.

This would be so much easier if I could just attach a screenshot. :banghead:
 
Upvote 0
I mean before the first data row ..
Applying the borders as you have described, I don't get a problem with inserting a new row 5. However, if you do get the problem, when you insert the new row 5, there should be a small paintbrush icon appear from which you can choose "Format Same As Below".


.. or after the last one.
I presume that you must also have something below row 8 that also has borders, otherwise I don't get this problem either. If you set up your initial borders a bit differently, you should be able to deal with this too, also using that paintbrush icon that appears when you insert the row. You need to make that border between row 8 and row 9 a top border on row 9 and not a bottom border on row 8 (which it currently is since it is 'around' C4:C8 etc). So, if you remove the bottom borders from row 8 and insert top borders on row 9 If they are cnot already there) then when you insert that new row you can choose "Format Same As Above" from the paintbrush icon if required.

Edit: On further testing, I'm only having limited success with the bottom part of the table. Sometimes seems to work, sometimes not.
 
Last edited:
Upvote 0
I should have been a bit more clear. Let me try again.

I am not inserting a row. I am replicating one. I do that because the actual table is much larger and more complicated than this example. It has several cells with formulas that I want to replicate in the new row. So I select a row and then copy it by Ctrl-Shift dragging it. This copies not only the formulas but also the formatting. Unfortunately, the formatting includes the borders.

I think a combination of your suggestion about applying the border to the row outside the table plus using Insert Row rather than copy and then copy the formatting from a middle row will work.

Thanks for the help...
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top