We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4277050 commit 7e86884Copy full SHA for 7e86884
1 file changed
lib/rubydown.rb
@@ -9,21 +9,23 @@
9
10
class Numo::NArray
11
def to_html
12
- rows = self.to_a.map do |row|
13
- elems = row.map do |elem|
+ case ndim
+ when 2
14
+ rows = self.to_a.map do |row|
15
+ elems = row.map do |elem|
16
+ "<td>#{elem}</td>"
17
+ end
18
+ "<tr>#{elems.join}</tr>"
19
20
+ "<table>#{rows.join}</table>"
21
+ when 1
22
+ cols = self.to_a.map do |elem|
23
"<td>#{elem}</td>"
24
end
- "<tr>#{elems.join}</tr>"
25
+ "<table><tr>#{cols.join}</tr></table>"
26
+ else
27
+ inspect
28
- "<table>#{rows.join}</table>"
- end
-end
-
-class Numo::Int32
- def to_html
- <<-HTML
- #{self.to_a}
- HTML
29
30
31
0 commit comments