CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   how to join two fields of a table (http://www.codingforums.com/showthread.php?t=282906)

eydg 11-24-2012 08:25 PM

how to join two fields of a table
 
a simple case - no doubt, but i am in no way able to make the bottom two fields one.

other than replace them with another embedded table, but it is not elegant.

please help

Code:

<table">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>


LearningCoder 11-24-2012 08:40 PM

You can use the colspan attribute on ONE of the <td> elements, like so:

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title here</title>
<style type="text/css">

table {border: 1px solid black;}

td {border: 1px solid black;}

</style>

</head>
<body>


<table>
  <tr>
    <td>a</td>
    <td>b</td>
  </tr>
  <tr>
    <td colspan="2">c d</td>
  </tr>
</table>

</body>
</html>

Regards,

LC.


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.