HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Dividing tables
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
hl_world



Joined: 28 Feb 2008
Posts: 3

PostPosted: Thu Feb 28, 2008 3:13 pm     Dividing tables Reply with quote

I have a table that measures 100 cells by 50 (no kidding) but I want to apply a sort of intercellular border every 10 cells horizontally and vertically. How would I do this without destroying my large table and putting its data in 50 independant tables?

Thanks
Corey Bryant



Joined: 15 May 2004
Posts: 8154
Location: Castle Rock CO USA

PostPosted: Thu Feb 28, 2008 3:41 pm     Reply with quote

You can create a style that applies a border to certain cells - maybe something like
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>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Untitled 3</title>
<style type="text/css">
td
{
   width:20px
}
td.intercellular
{
   border: 2px solid #000;
}
</style>

</head>

<body>

<table style="width: 100%">
   <tr>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
   </tr>
   <tr>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
   </tr>
   <tr>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
   </tr>
   <tr>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
   </tr>
   <tr>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
   </tr>
</table>

</body>

</html>

_________________
Corey
Payment Processing Forums | Mile High Merchant Accounts | Expression Web Blog
hl_world



Joined: 28 Feb 2008
Posts: 3

PostPosted: Thu Feb 28, 2008 7:04 pm     Reply with quote

Well I already have like 20 different classes for the fields and each cell is seperately by a black line of 1 pixel instead of cellspacing (I think this is the default). This is the structure of the file:
Code:

classes (including backgrounds, cell borders, text size etc.)

[table]
row 1 (each row is 100 cells)
row 2
row 3
etc for 47 more.
[/table]

But I was wondering how to apply cellspacing that seperated the table into 10x10 sections but still be 1 table in code
Corey Bryant



Joined: 15 May 2004
Posts: 8154
Location: Castle Rock CO USA

PostPosted: Fri Feb 29, 2008 7:26 am     Reply with quote

You can apply another class to tds
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>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Untitled 3</title>
<style type="text/css">
td
{
   width:20px
}
td.intercellular
{
   border: 2px solid #000;
}
td.anotherone
{
   background-color:#cccccc;
}
</style>

</head>

<body>

<table style="width: 100%">
   <tr>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular anotherone">lorem ipsum</td>
      <td>lorem ipsum</td>
   </tr>
   <tr>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular anotherone">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
   </tr>
   <tr>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td class="intercellular anotherone">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td>lorem ipsum</td>
   </tr>
   <tr>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular anotherone">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
   </tr>
   <tr>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
      <td>lorem ipsum</td>
      <td class="intercellular">lorem ipsum</td>
   </tr>
</table>

</body>

</html>
Cellpadding is only in a <table> element, not <td>. You can use styles those to create padding / margin though to specific <td>.

_________________
Corey
Payment Processing Forums | Mile High Merchant Accounts | Expression Web Blog
hl_world



Joined: 28 Feb 2008
Posts: 3

PostPosted: Fri Feb 29, 2008 4:22 pm     Reply with quote

So there's no way to do this without changing each td data lines individually? Well, thanks anyway.
Corey Bryant



Joined: 15 May 2004
Posts: 8154
Location: Castle Rock CO USA

PostPosted: Sat Mar 01, 2008 9:46 am     Reply with quote

If I am understanding you correctly - no.

If by chance you have a piece of your original code and then maybe a piece that is the way you would like it - that might help a bit more.

_________________
Corey
Payment Processing Forums | Mile High Merchant Accounts | Expression Web Blog
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial