WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You

WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Accespted Draw a vertical line with HTML Wed Jul 07, 2010 12:20 am

Guest


Guest
Draw a vertical line with HTML
Working with the tables


Okay guys i know many of you wonder how to create a thin vertical line.So we are here to show you how! Smile .However WebArtz doesn't support HTML so sorry i cant post samples you will have to work it at your HTML pages.

You all know how we can make a horizontal HTML line,we just insect that code:

<hr />
But what happens with Vertical lines?

A vertical line is easy to achieve but appears to be little-documented. There are two simple ways to do this:

1. the all-browser-compatible way

The HTML is this one:
<table cellspacing="5" border="0" cellpadding="0">
<tr valign="top" align="left">
<td width="300"><p>The main page content here</p></td>
<td width="1" bgcolor="#00FFFF"><BR></td>
<td width="150" valign="top" align="left">
<p>TextTextText</p>
<p>text<br>text<br>text</p>
</td>
</tr>
</table>

The first, wider column contains the main text, with the third column containing the 'news' section. The middle column contains the thin line, which appears thicker in this example only because the table borders are made visible; normally, you would set the border to have a width of zero in this kind of layout.

Question Question: So whats going on there? Neutral Question

Exclamation Answer: Exclamation
* no table border (set it explicity to zero)
* the column which contains the line should have a width of 1 pixel, must not have the align or valign parameters set, and must contain some contents which must not widen the column; a single <BR> element can be used, or I prefer a 1-pixel square transparent .GIF file
* the table's cellpadding attribute must be set to zero or the line will be thickened
* the table's cellspacing can be set to greater than zero to achieve a gap between the line and the cell contents, but if this is done the table can only contain one row; otherwise, the vertical line will be interrupted by the extra spacing (try it and see) Wink

2. using a CSS style (more simple and the one i use Wink )


You can use a much simpler technique, which saves fiddling around with the table. All you have to do is set a left (or right) border for a cell in a table. This can be included in a style sheet if you wish. The CSS syntax is the following:

<TD style="border-left: 1px solid cyan; padding: 5px;">
You can edit the border,the pixels,the color and the padding. Wink

The advantage of this method is that you can have more than one row in the table, and the vertical line won't be interrupted. Wink

Hope you found my tutorial useful Wink


Visit the WebArtz Online HTML Editor to test the codes!

Notice : This tutorial is copyrighted by WebArtz Forum. You may not publish it on anywhere without written permission from the administrators.

2Accespted Re: Draw a vertical line with HTML Sat Jul 10, 2010 1:56 pm

ankillien

ankillien
Administrator
Administrator
Nice one there Very Happy

Tutorial Accepted

3Accespted Re: Draw a vertical line with HTML Sat Jul 10, 2010 5:41 pm

Guest


Guest
Sorry mate but you wrote wrong title.
Its "Draw a vertical line with HTML"
"Working with Tables"

Wink

4Accespted Re: Draw a vertical line with HTML Sat Jul 10, 2010 6:48 pm

ankillien

ankillien
Administrator
Administrator
Oops Embarassed sorry.
Corrected now Smile

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum