html-table 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +3 -1
  3. data.tar.gz.sig +0 -0
  4. data/CHANGES +159 -155
  5. data/MANIFEST +59 -59
  6. data/README +132 -132
  7. data/certs/djberg96_pub.pem +22 -17
  8. data/doc/attributes.rdoc +143 -143
  9. data/doc/table.rdoc +158 -158
  10. data/doc/table_body.rdoc +9 -9
  11. data/doc/table_caption.rdoc +9 -9
  12. data/doc/table_colgroup.rdoc +8 -8
  13. data/doc/table_colgroup_col.rdoc +9 -9
  14. data/doc/table_content.rdoc +15 -15
  15. data/doc/table_foot.rdoc +8 -8
  16. data/doc/table_head.rdoc +11 -11
  17. data/doc/table_row.rdoc +105 -105
  18. data/doc/table_row_data.rdoc +92 -92
  19. data/doc/table_row_header.rdoc +7 -7
  20. data/examples/advanced.rb +128 -128
  21. data/examples/intermediate1.rb +72 -72
  22. data/examples/intermediate2.rb +62 -62
  23. data/examples/intermediate3.rb +46 -46
  24. data/examples/simple1.rb +39 -39
  25. data/examples/simple2.rb +47 -47
  26. data/examples/simple3.rb +41 -41
  27. data/html-table.gemspec +28 -28
  28. data/lib/html-table.rb +1 -1
  29. data/lib/html/attribute_handler.rb +403 -403
  30. data/lib/html/body.rb +37 -37
  31. data/lib/html/caption.rb +49 -49
  32. data/lib/html/col.rb +41 -41
  33. data/lib/html/colgroup.rb +113 -113
  34. data/lib/html/content.rb +18 -18
  35. data/lib/html/data.rb +69 -69
  36. data/lib/html/foot.rb +49 -49
  37. data/lib/html/head.rb +49 -49
  38. data/lib/html/header.rb +65 -65
  39. data/lib/html/html_handler.rb +120 -120
  40. data/lib/html/row.rb +188 -188
  41. data/lib/html/table.rb +323 -323
  42. data/lib/html/tablesection.rb +48 -48
  43. data/lib/html/tag_handler.rb +121 -121
  44. data/test/test_attribute_handler.rb +361 -361
  45. data/test/test_body.rb +87 -87
  46. data/test/test_caption.rb +80 -80
  47. data/test/test_col.rb +40 -40
  48. data/test/test_colgroup.rb +89 -89
  49. data/test/test_data.rb +77 -77
  50. data/test/test_foot.rb +111 -111
  51. data/test/test_head.rb +104 -104
  52. data/test/test_header.rb +77 -77
  53. data/test/test_html_handler.rb +37 -37
  54. data/test/test_row.rb +141 -141
  55. data/test/test_table.rb +159 -158
  56. data/test/test_tablesection.rb +42 -42
  57. data/test/test_tag_handler.rb +90 -90
  58. metadata +25 -20
  59. metadata.gz.sig +0 -0
data/README CHANGED
@@ -1,132 +1,132 @@
1
- == Description
2
- An interface for generating HTML Tables with Ruby.
3
-
4
- == Prerequisites
5
- * strongtyping 2.0.6 or later
6
- * structured_warnings 0.3.0 or later
7
-
8
- == Installation
9
- gem install html-table
10
-
11
- == Synopsis
12
- require 'html/table'
13
- include HTML
14
-
15
- # Explicit syntax
16
- table = HTML::Table.new{ |t|
17
- t.border = 1
18
- t.bgcolor = "red"
19
- }
20
-
21
- # Implicit syntax
22
- table = HTML::Table.new do
23
- border 1
24
- bgcolor 'red'
25
- end
26
-
27
- table.push Table::Row.new{ |r|
28
- r.align = "left"
29
- r.bgcolor = "green"
30
- r.content = ["foo","bar","baz"]
31
- }
32
-
33
- row = Table::Row.new{ |r|
34
- r.align = "right"
35
- r.bgcolor = "blue"
36
- r.content = "hello world"
37
- }
38
-
39
- table[1] = row
40
-
41
- puts table.html
42
-
43
- # Output
44
- <table border=1 bgcolor='red'>
45
- <tr align='left' bgcolor='green'> # row 0
46
- <td>foo</td> # column 0
47
- <td>bar</td> # column 1
48
- <td>baz</td> # column 2
49
- </tr>
50
- <tr align='right' bgcolor='blue'> # row 1
51
- <td>hello world</td> # column 0
52
- </tr>
53
- </table>
54
-
55
- See the 'examples' directory under 'doc' for more examples.
56
-
57
- == Mixins
58
- Table is a subclass of Array, and therefore mixes in Enumerable. The
59
- push, unshift and []= methods have been modified. See below for details.
60
-
61
- Table also mixes in AttributeHandler which provides methods for adding
62
- attributes to each of the tag types. See attributes.rdoc for more details.
63
-
64
- == Notes
65
- A Table consists of Table::Row, Table::Caption, Table::ColGroup,
66
- Table::Body, Table::Foot, Table::Head and Table::Row objects.
67
-
68
- Table::Row objects in turn consist of Table::Row::Data and
69
- Table::Row::Header objects.
70
-
71
- Table::ColGroup objects consist of Table::ColGroup::Col
72
- objects.
73
-
74
- Table::Head, Table::Body and Table::Foot objects consist
75
- of Table::Row objects.
76
-
77
- String attributes are quoted. Numeric attributes are not.
78
-
79
- Some attributes have type checking. Some check for valid arguments. In
80
- the latter case, it is case-insensitive. See the documentation on
81
- specific methods for more details.
82
-
83
- Using a non-standard extension (e.g. "background") will emit a
84
- NonStandardExtensionWarning. See the documentation for structured_warnings
85
- for more information on how to control these.
86
-
87
- == Known Bugs
88
- None that I'm aware of. Please report bugs on the project page at:
89
-
90
- http://github.com/djberg96/html-table
91
-
92
- == Future Plans
93
- Documentation improvements (include inline links to other files).
94
-
95
- == Acknowledgements
96
- Anthony Peacock, for giving me ideas with his HTML::Table Perl module.
97
- Holden Glova and Culley Harrelson for API suggestions and comments.
98
-
99
- == License
100
- Artistic 2.0
101
-
102
- == Copyright
103
- (C) 2003-2017 Daniel J. Berger
104
- All Rights Reserved
105
-
106
- == Warranty
107
- This package is provided "as is" and without any express or
108
- implied warranties, including, without limitation, the implied
109
- warranties of merchantability and fitness for a particular purpose.
110
-
111
- == Author
112
- Daniel J. Berger
113
-
114
- == Developer's Notes
115
- Some people might be a little annoyed with the fact that I required Ryan
116
- Pavlik's strongtyping library. I'm not a big fan of strong typing myself.
117
- So, why did I do this?
118
-
119
- Normally when creating code, you setup your own rules as far as what is
120
- allowed as an argument. You publish the API, set up a good set of tests,
121
- and don't bother worrying about types because you figure people can read
122
- the API and won't go out of their way to break it. You certainly don't
123
- worry about it yourself because you're used to dynamic languages and find
124
- that you don't need the strong typing training wheels after all, right?
125
-
126
- However, HTML tables have a predefined set of rules as far as what content
127
- is valid, and where it's placed in order to be HTML 4.0 compliant. For
128
- example, if a caption is included, it should be at the 'top' of your table
129
- syntax, you can only have one foot section, and so on. I therefore chose to
130
- enforce these conventions and rules in Ruby via Ryan's module. I could have
131
- lived without it, and instead chose to do a plethora of "kind_of?" checks.
132
- However, Ryan's package is both faster and required less typing on my part.
1
+ == Description
2
+ An interface for generating HTML Tables with Ruby.
3
+
4
+ == Prerequisites
5
+ * strongtyping 2.0.6 or later
6
+ * structured_warnings 0.3.0 or later
7
+
8
+ == Installation
9
+ gem install html-table
10
+
11
+ == Synopsis
12
+ require 'html/table'
13
+ include HTML
14
+
15
+ # Explicit syntax
16
+ table = HTML::Table.new{ |t|
17
+ t.border = 1
18
+ t.bgcolor = "red"
19
+ }
20
+
21
+ # Implicit syntax
22
+ table = HTML::Table.new do
23
+ border 1
24
+ bgcolor 'red'
25
+ end
26
+
27
+ table.push Table::Row.new{ |r|
28
+ r.align = "left"
29
+ r.bgcolor = "green"
30
+ r.content = ["foo","bar","baz"]
31
+ }
32
+
33
+ row = Table::Row.new{ |r|
34
+ r.align = "right"
35
+ r.bgcolor = "blue"
36
+ r.content = "hello world"
37
+ }
38
+
39
+ table[1] = row
40
+
41
+ puts table.html
42
+
43
+ # Output
44
+ <table border=1 bgcolor='red'>
45
+ <tr align='left' bgcolor='green'> # row 0
46
+ <td>foo</td> # column 0
47
+ <td>bar</td> # column 1
48
+ <td>baz</td> # column 2
49
+ </tr>
50
+ <tr align='right' bgcolor='blue'> # row 1
51
+ <td>hello world</td> # column 0
52
+ </tr>
53
+ </table>
54
+
55
+ See the 'examples' directory under 'doc' for more examples.
56
+
57
+ == Mixins
58
+ Table is a subclass of Array, and therefore mixes in Enumerable. The
59
+ push, unshift and []= methods have been modified. See below for details.
60
+
61
+ Table also mixes in AttributeHandler which provides methods for adding
62
+ attributes to each of the tag types. See attributes.rdoc for more details.
63
+
64
+ == Notes
65
+ A Table consists of Table::Row, Table::Caption, Table::ColGroup,
66
+ Table::Body, Table::Foot, Table::Head and Table::Row objects.
67
+
68
+ Table::Row objects in turn consist of Table::Row::Data and
69
+ Table::Row::Header objects.
70
+
71
+ Table::ColGroup objects consist of Table::ColGroup::Col
72
+ objects.
73
+
74
+ Table::Head, Table::Body and Table::Foot objects consist
75
+ of Table::Row objects.
76
+
77
+ String attributes are quoted. Numeric attributes are not.
78
+
79
+ Some attributes have type checking. Some check for valid arguments. In
80
+ the latter case, it is case-insensitive. See the documentation on
81
+ specific methods for more details.
82
+
83
+ Using a non-standard extension (e.g. "background") will emit a
84
+ NonStandardExtensionWarning. See the documentation for structured_warnings
85
+ for more information on how to control these.
86
+
87
+ == Known Bugs
88
+ None that I'm aware of. Please report bugs on the project page at:
89
+
90
+ http://github.com/djberg96/html-table
91
+
92
+ == Future Plans
93
+ Documentation improvements (include inline links to other files).
94
+
95
+ == Acknowledgements
96
+ Anthony Peacock, for giving me ideas with his HTML::Table Perl module.
97
+ Holden Glova and Culley Harrelson for API suggestions and comments.
98
+
99
+ == License
100
+ Artistic 2.0
101
+
102
+ == Copyright
103
+ (C) 2003-2018 Daniel J. Berger
104
+ All Rights Reserved
105
+
106
+ == Warranty
107
+ This package is provided "as is" and without any express or
108
+ implied warranties, including, without limitation, the implied
109
+ warranties of merchantability and fitness for a particular purpose.
110
+
111
+ == Author
112
+ Daniel J. Berger
113
+
114
+ == Developer's Notes
115
+ Some people might be a little annoyed with the fact that I required Ryan
116
+ Pavlik's strongtyping library. I'm not a big fan of strong typing myself.
117
+ So, why did I do this?
118
+
119
+ Normally when creating code, you setup your own rules as far as what is
120
+ allowed as an argument. You publish the API, set up a good set of tests,
121
+ and don't bother worrying about types because you figure people can read
122
+ the API and won't go out of their way to break it. You certainly don't
123
+ worry about it yourself because you're used to dynamic languages and find
124
+ that you don't need the strong typing training wheels after all, right?
125
+
126
+ However, HTML tables have a predefined set of rules as far as what content
127
+ is valid, and where it's placed in order to be HTML 4.0 compliant. For
128
+ example, if a caption is included, it should be at the 'top' of your table
129
+ syntax, you can only have one foot section, and so on. I therefore chose to
130
+ enforce these conventions and rules in Ruby via Ryan's module. I could have
131
+ lived without it, and instead chose to do a plethora of "kind_of?" checks.
132
+ However, Ryan's package is both faster and required less typing on my part.
@@ -1,21 +1,26 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
2
+ MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
3
3
  cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
- MB4XDTE2MTIxMjAwMTQ1M1oXDTE3MTIxMjAwMTQ1M1owPzERMA8GA1UEAwwIZGpi
4
+ MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
5
5
  ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVtTm/wETO8yKVKRPBO
7
- VgPRvE94iEfKryOb/tQrmhGhchG2ALqdw/r54cGJvLaXeItrYJ6N8pSE/FSnN5jM
8
- xugUhHBprPl+AsQ4E+IBy0dKwyU8XjFoVYzWvT1wnqwQdSazdgFCfQqb51QCgUIT
9
- PGGakKlyzCb3Mbq30is8+QlRrqXt/JbpkUZbQwUqCdAulMT4oyPBk/L+48pbVX0s
10
- 4yj7YaVAqfGByAMTPXEmUS388lX+0xq8+GGir2Fuh0TpNW0ggr9BxprwqL0Mg4Oo
11
- YhM5L1y8Plolo8mOTN3+K8I3afZ0lD0BtwniVb6g+Ut/4aBjKy2+GyFwwNOu0gSj
12
- desCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFJfg
13
- HmQ0uDU3Z9A9hB1lQMjr5VZSMB0GA1UdEQQWMBSBEmRqYmVyZzk2QGdtYWlsLmNv
14
- bTAdBgNVHRIEFjAUgRJkamJlcmc5NkBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
15
- ggEBACjRCHRP944MHIQJNCglZbDnZowybV2HxmG1uhnvRwrOjBA7CXemc+QSAL7K
16
- 7eXC4FdojVEJrnU7ZxuCmfQU+fvkEQKOnah1osG1874aPiDlwtjHclpeqcDgTUI7
17
- A7CF+OXK8x7ksFx205ruhPHKaPYtwVG/W/J+y7Wx8yl9rvwUgRBL5cVzTBiEz+AB
18
- NRT7yoHXXfFXjuQWN1eHunSbNds2ZTGQd64yBCujb17Xdl+F9tu4klkTga3gxP3P
19
- y3zoX1VttxnIZBojRM/s2A7c2aubMH2SVbXMR3ccVkB9XbYKl1OvCe7q85xEHit2
20
- Kbpico5nnyHqf7YSPmvZe8bCU94=
6
+ bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
7
+ A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
8
+ u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
9
+ 75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
10
+ 6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
11
+ iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
12
+ ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
13
+ 74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
14
+ 058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
15
+ HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
16
+ AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
17
+ YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
18
+ /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
19
+ h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
20
+ 6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
21
+ ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
22
+ 1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
23
+ DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
24
+ ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
25
+ WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
21
26
  -----END CERTIFICATE-----
@@ -1,143 +1,143 @@
1
- == Description
2
- A list of attributes handled by html-table. Each of the writers has a
3
- corresponding reader unless otherwise stated.
4
-
5
- == Attributes
6
- abbr=(string)
7
- Sets the value for the abbr attribute.
8
-
9
- align=(string)
10
- Sets the align attribute. Valid arguments are 'left', 'center' and
11
- 'right'. An ArgumentError is raised if an invalid argument is passed.
12
-
13
- axis=(string)
14
- Sets the value for the axis attribute.
15
-
16
- background=(url)
17
- Sets the background attribute. The url must be a String or a TypeError
18
- is raised. This is a non-standard extension.
19
-
20
- bgcolor=(color)
21
- Sets the color for the bgcolor attribute. Hex values should still be
22
- quoted, e.g. "#F80000".
23
-
24
- border=(num)
25
- Sets the value for the border attribute.
26
-
27
- bordercolor=(color)
28
- Sets the color for the bordercolor attribute. This is a non-standard
29
- extension.
30
-
31
- bordercolordark=(color)
32
- Sets the color for the bordercolordark attribute. This is a non-standard
33
- extension.
34
-
35
- bordercolorlight=(color)
36
- Sets the color for the bordercolorlight attribute. This is a non-standard
37
- extension.
38
-
39
- cellpadding=(num)
40
- Sets the value for the cellpadding attribute. Raises an ArgumentError if
41
- num.to_i is less than 0.
42
-
43
- cellspacing=(num)
44
- Sets the value for the cellspacing attribute. Raises an ArgumentError if
45
- num.to_i is less than 0.
46
-
47
- char=(character)
48
- Sets the value for the char attribute. An ArgumentError is raised if the
49
- argument passed has a length greater than 1 (i.e. it may only be a char).
50
-
51
- charoff=(value)
52
- Sets the value for the charoff attribute.
53
-
54
- colspan=(num)
55
- Sets the colspan attribute.
56
-
57
- content=(*args)
58
- The behavior of this method varies largely based on the type of instance
59
- that invokes it. Here are the rules for each +arg+ in +args+:
60
-
61
- +Table+:
62
-
63
- If +arg+ is a Row, Head, Foot, Body or ColGroup object, it is
64
- pushed onto the table. If +arg+ is a string, one Row object with
65
- one one Data object is pushed onto the Table. If +arg+ is an Array,
66
- one Row object is created and each element of the array is pushed
67
- onto that Row.
68
-
69
- +Table::Row+:
70
-
71
- If +arg+ is a Header or Data object, it is pushed onto the Row. If
72
- +arg+ is a String, it is created as a single Data object. Attempts
73
- to assign any other type will raise a TypeError.
74
-
75
- +Table::Head, Table::Foot, Table::Body+:
76
-
77
- Behave identically to Table::Row except that they accept Table::Row
78
- objects as well.
79
-
80
- +Table::ColGroup+:
81
-
82
- Behaves identically to Table::Row except that it only accepts Col objects.
83
-
84
- +Table::Col+:
85
-
86
- This method is undefined for Table::Col, because they do not accept
87
- content.
88
-
89
- +Table::Data and Table::Header+:
90
-
91
- Sets the text string for the Data or Header object. Arrays are join'd.
92
- Any other type raises a TypeError.
93
-
94
- frame=(type)
95
- Sets the value for the frame attribute. Valid values are border, void,
96
- above, below, hsides, lhs, rhs, vsides, and box. An ArgumentError is
97
- raised if an invalid type is detected.
98
-
99
- height=(num)
100
- Sets the value for the height attribute. Raises an ArgumentError if
101
- num.to_i is less than 0.
102
-
103
- hspace=(num)
104
- Sets the value for the hspace attribute. Raises an ArgumentError if
105
- num.to_i is less than 0.
106
-
107
- nowrap=(bool)
108
- Sets the value for the nowrap attribute. Setting it to true means it will
109
- be included as an attribute for the Table object. The default is false
110
- (i.e. not included).
111
-
112
- rowspan=(num)
113
- Sets the value for the rowspan attribute.
114
-
115
- rules=(edges)
116
- Sets the value for the rules attribute. Valid values are all, groups,
117
- rows, cols, or none. An ArgumentError is raised if an invalid edges value
118
- is detected.
119
-
120
- scope=(scope)
121
- Sets the value for the scope attribute. Valid values for +scope+ are
122
- row, col, rowgroup or colgroup. An ArgumentError is raised if an invalid
123
- scope value is passed.
124
-
125
- span=(num)
126
- Sets the span attribute. If num.to_i is less than 0, and ArgumentError
127
- is raised.
128
-
129
- summary=(string)
130
- Sets the value for the summary attribute.
131
-
132
- valign=(position)
133
- Sets the value for the valign attribute. Valid values are top, center,
134
- bottom, and baseline. This is a non-standard extension.
135
-
136
- vspace=(num)
137
- Sets the value for the vspace attribute. This is a non-standard
138
- extension.
139
-
140
- width=(num)
141
- Sets the value for the width attribute. If num is in 'x%' format, it
142
- is retained as a string. If num is a Fixnum (or stringified number), an
143
- ArgumentError is raised if num.to_i is less than 0.
1
+ == Description
2
+ A list of attributes handled by html-table. Each of the writers has a
3
+ corresponding reader unless otherwise stated.
4
+
5
+ == Attributes
6
+ abbr=(string)
7
+ Sets the value for the abbr attribute.
8
+
9
+ align=(string)
10
+ Sets the align attribute. Valid arguments are 'left', 'center' and
11
+ 'right'. An ArgumentError is raised if an invalid argument is passed.
12
+
13
+ axis=(string)
14
+ Sets the value for the axis attribute.
15
+
16
+ background=(url)
17
+ Sets the background attribute. The url must be a String or a TypeError
18
+ is raised. This is a non-standard extension.
19
+
20
+ bgcolor=(color)
21
+ Sets the color for the bgcolor attribute. Hex values should still be
22
+ quoted, e.g. "#F80000".
23
+
24
+ border=(num)
25
+ Sets the value for the border attribute.
26
+
27
+ bordercolor=(color)
28
+ Sets the color for the bordercolor attribute. This is a non-standard
29
+ extension.
30
+
31
+ bordercolordark=(color)
32
+ Sets the color for the bordercolordark attribute. This is a non-standard
33
+ extension.
34
+
35
+ bordercolorlight=(color)
36
+ Sets the color for the bordercolorlight attribute. This is a non-standard
37
+ extension.
38
+
39
+ cellpadding=(num)
40
+ Sets the value for the cellpadding attribute. Raises an ArgumentError if
41
+ num.to_i is less than 0.
42
+
43
+ cellspacing=(num)
44
+ Sets the value for the cellspacing attribute. Raises an ArgumentError if
45
+ num.to_i is less than 0.
46
+
47
+ char=(character)
48
+ Sets the value for the char attribute. An ArgumentError is raised if the
49
+ argument passed has a length greater than 1 (i.e. it may only be a char).
50
+
51
+ charoff=(value)
52
+ Sets the value for the charoff attribute.
53
+
54
+ colspan=(num)
55
+ Sets the colspan attribute.
56
+
57
+ content=(*args)
58
+ The behavior of this method varies largely based on the type of instance
59
+ that invokes it. Here are the rules for each +arg+ in +args+:
60
+
61
+ +Table+:
62
+
63
+ If +arg+ is a Row, Head, Foot, Body or ColGroup object, it is
64
+ pushed onto the table. If +arg+ is a string, one Row object with
65
+ one one Data object is pushed onto the Table. If +arg+ is an Array,
66
+ one Row object is created and each element of the array is pushed
67
+ onto that Row.
68
+
69
+ +Table::Row+:
70
+
71
+ If +arg+ is a Header or Data object, it is pushed onto the Row. If
72
+ +arg+ is a String, it is created as a single Data object. Attempts
73
+ to assign any other type will raise a TypeError.
74
+
75
+ +Table::Head, Table::Foot, Table::Body+:
76
+
77
+ Behave identically to Table::Row except that they accept Table::Row
78
+ objects as well.
79
+
80
+ +Table::ColGroup+:
81
+
82
+ Behaves identically to Table::Row except that it only accepts Col objects.
83
+
84
+ +Table::Col+:
85
+
86
+ This method is undefined for Table::Col, because they do not accept
87
+ content.
88
+
89
+ +Table::Data and Table::Header+:
90
+
91
+ Sets the text string for the Data or Header object. Arrays are join'd.
92
+ Any other type raises a TypeError.
93
+
94
+ frame=(type)
95
+ Sets the value for the frame attribute. Valid values are border, void,
96
+ above, below, hsides, lhs, rhs, vsides, and box. An ArgumentError is
97
+ raised if an invalid type is detected.
98
+
99
+ height=(num)
100
+ Sets the value for the height attribute. Raises an ArgumentError if
101
+ num.to_i is less than 0.
102
+
103
+ hspace=(num)
104
+ Sets the value for the hspace attribute. Raises an ArgumentError if
105
+ num.to_i is less than 0.
106
+
107
+ nowrap=(bool)
108
+ Sets the value for the nowrap attribute. Setting it to true means it will
109
+ be included as an attribute for the Table object. The default is false
110
+ (i.e. not included).
111
+
112
+ rowspan=(num)
113
+ Sets the value for the rowspan attribute.
114
+
115
+ rules=(edges)
116
+ Sets the value for the rules attribute. Valid values are all, groups,
117
+ rows, cols, or none. An ArgumentError is raised if an invalid edges value
118
+ is detected.
119
+
120
+ scope=(scope)
121
+ Sets the value for the scope attribute. Valid values for +scope+ are
122
+ row, col, rowgroup or colgroup. An ArgumentError is raised if an invalid
123
+ scope value is passed.
124
+
125
+ span=(num)
126
+ Sets the span attribute. If num.to_i is less than 0, and ArgumentError
127
+ is raised.
128
+
129
+ summary=(string)
130
+ Sets the value for the summary attribute.
131
+
132
+ valign=(position)
133
+ Sets the value for the valign attribute. Valid values are top, center,
134
+ bottom, and baseline. This is a non-standard extension.
135
+
136
+ vspace=(num)
137
+ Sets the value for the vspace attribute. This is a non-standard
138
+ extension.
139
+
140
+ width=(num)
141
+ Sets the value for the width attribute. If num is in 'x%' format, it
142
+ is retained as a string. If num is a Fixnum (or stringified number), an
143
+ ArgumentError is raised if num.to_i is less than 0.