Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing border from table cells

I know this is a dumb question but I seem to have totally forgotten how to do it.

I have a HTML table and I want to remove all borders around all the cells so that there is only one border around the entire table.

My code looks like:

<table border='1' width='500'>   <tr><th><h1>Your Wheelbarrow</h1></th><tr>     <th>Product</th>     <th>Description</th>     <th>Price</th>     <th>Quantity</th>     <th>Total</th>     <th>Delete</th>   </tr> 
like image 677
user1278496 Avatar asked Apr 12 '12 20:04

user1278496


People also ask

How do I remove borders from cells in a table?

Remove all borders to select the table and show the Table Design tab. On the Table Design tab, click the arrow next to Borders and then click No Border . Tip: Be sure to click Borders not Border Styles.

How do you remove a border from a specific row?

noBorder td to make the border go away for all the <td> s that are inside of <tr> s with the noBorder class by assigning border: 0 . Note that you do not need to provide the unit (i.e. px ) if you set something to 0 as it does not matter anyway. Zero is just zero.


1 Answers

Just collapse the table borders and remove the borders from table cells (td elements).

table {     border: 1px solid #CCC;     border-collapse: collapse; }  td {     border: none; } 

Without explicitly setting border-collapse cross-browser removal of table cell borders is not guaranteed.

like image 186
brezanac Avatar answered Sep 23 '22 12:09

brezanac