![]() |
|
|
#1 |
![]() Join Date: Nov 2008
Location: Birmingham, England...
Posts: 472 (0.29/day)
Thanks: 72
Thanked 27 Times in 22 Posts
|
HTML/CSS Table border question
Hi All
I'm trying to create a table with a border around the whole table... My code is below, but I'm having trouble trying to find how to add a border around the outline of the whole table instead of every cell? I'm using DW CS5. Thanks for reading! Code:
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4" bgcolor="#D4BF55">TITLE</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
__________________
![]() Last edited by Akumos; Jan 2, 2011 at 12:42 PM. |
|
|
|
|
|
#2 |
![]() Join Date: Mar 2009
Posts: 490 (0.32/day)
Thanks: 0
Thanked 171 Times in 158 Posts
|
Nested tables perhaps, main table with border and just one cell with a table with no border inside this only cell? Like this:
HTML Code:
<table width="90%" border="15"> <tbody> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td colspan="4" bgcolor="#D4BF55">TITLE</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> Last edited by temp02; Jan 2, 2011 at 12:55 PM. |
|
|
|
| The Following User Says Thank You to temp02 For This Useful Post: |
|
|
#3 |
![]() Join Date: Nov 2008
Location: Birmingham, England...
Posts: 472 (0.29/day)
Thanks: 72
Thanked 27 Times in 22 Posts
|
Thanks for the fast reply temp!!
I have already made most of the layouts and doing it this way would take me a while (some of the borders I only want around half the table). Is there a way of adding individual properties (eg. border-left or border-bottom (or the HTML equivilant) to the <td> tag?
__________________
![]() |
|
|
|
|
|
#4 |
![]() Join Date: Aug 2007
Location: Geneva, FL, USA
Posts: 3,010 (1.42/day)
Thanks: 567
Thanked 606 Times in 487 Posts
|
Give the table a style="border:1px solid black" instead of the border attribute.
|
|
|
|
| The Following User Says Thank You to Jizzler For This Useful Post: |
|
|
#5 |
![]() Join Date: Nov 2008
Location: Birmingham, England...
Posts: 472 (0.29/day)
Thanks: 72
Thanked 27 Times in 22 Posts
|
Where does the style tag go? inside <table...
__________________
![]() |
|
|
|
|
|
#6 |
![]() Join Date: Aug 2007
Location: Geneva, FL, USA
Posts: 3,010 (1.42/day)
Thanks: 567
Thanked 606 Times in 487 Posts
|
Yup. This would put a border on the table only. You can of course style it beyond my example.
HTML Code:
<table style="border:1px solid black"> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> For your other question, can make a class to style multiple tags. HTML Code:
<style type="text/css"> .bl { border-left:1px solid black; } </style> <table> <tr> <td class="bl"> </td> <td class="bl"> </td> <td> </td> <td> </td> </tr> </table> |
|
|
|
| The Following User Says Thank You to Jizzler For This Useful Post: |
|
|
#7 |
![]() Join Date: Nov 2008
Location: Birmingham, England...
Posts: 472 (0.29/day)
Thanks: 72
Thanked 27 Times in 22 Posts
|
Works perfectly, thanks Jizzler! I didn't know about styles!
Is there a way to apply a style to text.. kind of like h1, h2, h3 etc... When I try to reformat h2, h3 etc... I get a big gap underneath the text which I dont want!
__________________
![]() |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML DOM, Javascript Question | ct5098 | Programming & Webmastering | 6 | Dec 24, 2010 08:01 PM |
| some html php and mysql mixed question | r9 | Programming & Webmastering | 2 | Aug 30, 2009 04:24 PM |
| quick HTML question | Braveheart | Programming & Webmastering | 3 | Jul 5, 2009 08:42 AM |
| Css & Html | Wozzer | Programming & Webmastering | 12 | Sep 22, 2008 01:29 PM |
| Html/css | Thermopylae_480 | General Software | 1 | Oct 10, 2006 02:04 PM |