HTML Tutorial - Setting Table Size In Percentage And Pixels

  • Home
  • Scripts
      • Server Side Scripting

      • PHP
      • JSP
      • Perl
      • ASP
      • Client Side Scripting

      • JavaScript
      • AJAX
      • Jquery
      • Web Building Scripts

      • CSS3
      • Shell Scripts

      • Shell Scripts
      • Wordpress Plugins

      • PHP Plugins
      • Jquery Plugins
  • Tutorials
      • Web Technologies

      • CSS
      • CSS3
      • HTML
      • HTML5
      • Regular Expression
      • Programmings

      • CPP
      • VB.net

        Microsoft Technologies

      • Excel2007 Functions
      • Powerpoint
      • Scripts Programming

      • PHP
      • JSP
      • Perl
      • JavaScript
      • Jquery
      • Database Languages

      • MySQL

        Designing

      • Photoshop
      • Flash
      • GIMP
      • Commands/Services

      • Linux
      • SVN
      • VIM
      • CISCO Switch
      • Linux Services
      • Vista Services
      • Web Developments

      • RSS Feed
      • SEO
      • Web Building
      • Domain & DNS
      • Advertising Networks
  • Tools
      • Calculator / Converters

      • Hours Calculator
      • Epoch-GMT Converter
      • Online Image Converter
      • Convert Images

        Lookup / Analysis

      • Apache Version Lookup
      • Email Verification Tool
      • Statistics Tool
      • Form Effects

      • Button Creator
      • Form Generator
      • Random Words Generator
      • Web Color Chooser

        Menu Effects

      • Menu Builder
      • Multiple Drop Down Menu
      • Image / Text Effects

      • Gif Image Creator
      • Compress, Resize Pictures
      • Thumbnail Image Generator
      • CSS Image Sprites Generator
      • Image Resizer and Cropper Tool
      • Text Animation Tool
      • IP / DNS Lookup

      • IP/DNS Tools
      • Find Ip Address
      • Hostname to IP Address

        Password Generators

      • Htpasswd Generator
      • MD5 Hash Encrypter
      • Random Password Generator
      • Password Strength
      • SEO Analysis

      • Backlink Checker
      • Link Analyser
      • FBLike Count Calculator
      • Website Popularity
      • Page Rank Tool
      • If Modified Since Http Header
      • SEO Text Browser Tool
  • Snippets
      • Add Snippets
      • New Snippets
      • Categories
  • FAQ
  • Statistics
      • Browser Statistics
      • OS Statistics
      • Search Engine Statistics
  • Paid Scripts
      • PHP
      • JSP
      • JavaScript
  • Web Icons
      • Cliparts
      • Traffic Signs
      • Country Maps
      • Country Emblems
      • Background Images
      • Menu Buttons
      • Logos
  • PDF
  • Home
  • >>
  • Tutorials
  • >>
  • Html
  • >>
  • Using Tables
  • >>
  • HTML Table Size - code
HTML Table Size - code

How to create table with different size?How to split the size of the table columns?

Explanation

Table Size
We can set the size of the table based of pixels or percentage. First we will see how to set size based on pixels. The attribute width and height will be used. Example : <table border=1 bgcolor="green" width=300 height=100><tr height=30><td>This is 1st row 1st column</td><td>This is 1st row 2nd column</td></tr> <tr height=70><td>This is 2nd row 1st column</td><td background="./test.jpg">This is 2nd row 2nd column <br><br> Nice background </td></tr> </table>Now we have set the total table width as 300 and height as 100 and split them as 30 to first row and 70 to second row.Result :
This is 1st row 1st column This is 1st row 2nd column
This is 2nd row 1st column This is 2nd row 2nd column Nice background
Table Size in percentage
Table width and height can be set using percentage.e.g: width=60%.This means that the table with be drawn to 60% width of the current component.i.e. if we are drawing a table inside a body tag and using width as 100%, then the width of the table will be equal to the browser width.Table can be drawn inside tables. We will see about it later.Example : <table border=1 bgcolor="green" width=80% height=20%><tr height=30%><td>This is 1st row 1st column</td><td>This is 1st row 2nd column</td></tr> <tr height=70%><td>This is 2nd row 1st column</td><td background="./test.jpg">This is 2nd row 2nd column <br><br> Nice background </td></tr> </table>Now we have set the total table width as 80% and height as 30% and split the height as 30% to first row and 70% to second row.To explain in depth, say we have the component size as width=500,height=500 so the table will now take 80% of 500 (400) as its total width and 30% of 500 (150) as its total height. Then it will split that 150 height in to 30% for first row and 70% for second row.Result :
This is 1st row 1st column This is 1st row 2nd column
This is 2nd row 1st column This is 2nd row 2nd column Nice background
PreviousNext

HTML Basic

  • Introduction
  • Beginners Guide
    • How To
    • Tags List
  • HTML Tags
  • html, head, body
    • Head Tag
    • Body Tag
    • BgColor
    • Background
  • Text Manipulation
    • b,u,i,center,br
    • hr,ur,li,ol
    • h1,space,div
    • pre,font
    • strike,power
    • p tag
  • IMAGES
    • Link Basics
    • Using Links
    • Email Link
  • Special Effects
    • Marquee 1
    • Marquee 2
    • Blink
  • Using Tables
    • Tables
    • Table Border
    • Table Color
    • Table Size
    • Table Align
    • Inner Table
    • Col Span
    • Row Span
  • Forms
    • Form Types
    • Text Fields
    • Buttons
    • Radio Button
    • CheckBox
    • Text Area
    • Select Box
    • Password
    • Label
  • Other Topics
    • Special Characters
    • Special Characters1
    • Redirect
    • Auto Refresh
    • IFrame
    • AddressBar
    • Simple CSS
  • Media
    • Audio embed
    • Video
  • Meta Tags
    • Meta Tag
    • Meta Tag 2
  • Frame tags
    • Frameset
    • Inline frames
  • HTML Fieldset
  • HTML Tooltip
  • HTML DTD
  • Image Tags
    • Image button
    • Image Map
  • Subscript & Superscript
  • HTML Bullet Styles
  • Canvas Tags
  • HTML Quotations
    • q, blockqoute tag
    • abbr, address tag
    • cite, bdo tag
  • HTML ComputerCode
  • HTML Comments
  • HTML Styles
  • Other tags
    • Phrase
    • Anchor
    • Example for Anchor
    • Acron Tag
  • HTML Javascript
  • HTML PHP
  • Feedback

Ask Questions

Ask Question

Từ khóa » Html Table Column Size Percentage